package com.neusoft.chenanqi.dao;

import java.util.List;

import javax.inject.Inject;

import org.springframework.stereotype.Repository;

import com.neusoft.chenanqi.dto.EmpSalDto;
import com.zero.basic.dao.SqlListBaseDao;
import com.zero.basic.exception.SmsDaoException;
import com.zero.mms.model.SalaryItem;

@Repository("salItemDao")
public class SalItemDaoImpl implements SalItemDao {

	@Inject
	private SqlListBaseDao<?> sqlListBaseDao;

	@Override
	public List<SalaryItem> listSalItemByType(String type)
			throws SmsDaoException {
		try {
			String sql = "select i.* from t_salary_item i "
					+ "where i.salary_item_type = " + type;
			List<SalaryItem> salaryItemList = sqlListBaseDao.listBySql(sql,
					SalaryItem.class, true, true);
			return salaryItemList;
		} catch (Exception e) {
			throw new SmsDaoException();
		}
	}

}
